#define _CRT_SECURE_NO_WARNINGS 1

#include <ctype.h>
#include <stdio.h>
#include <string.h>

int main() {
    char ch[100];
    int n;
    while (scanf("%d", &n) != EOF)
    {
        scanf("%s", ch);
        int length = strlen(ch);
        int flag = 0;
        int upper = 0;
        int digit = 0;
        int slower = 0;
        for (int i = 0; i < length; ++i)
        {
            if (!isalnum(ch[i]))
            {
                flag = 1;
                break;
            }
            if (isdigit(ch[i]))
                digit = 1;
            if (islower(ch[i]))
                slower = 1;
            if (isupper(ch[i]))
                upper = 1;
        }
        if (isdigit(ch[0]))
        {
            flag = 1;
        }
        if (length < 8 || flag || digit + slower + upper < 2)
        {
            printf("NO\n");
        }
        else {
            {
                printf("YES\n");
            }
        }
    }
    return 0;
}